IF (CMAKE_HOST_WIN32)

	SET(TACRYPTO_DIR ${THIRD_PARTY}/windows/x86/tacrypto)
	IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
		SET(TACRYPTO_DIR ${THIRD_PARTY}/windows/x64/tacrypto)
	ENDIF()

	SET(TACRYPTO_INCLUDE_DIR ${TACRYPTO_DIR}/include)
	SET(TACRYPTO_LIB_DIR  ${TACRYPTO_DIR}/lib)
	SET(TACRYPTO_LIBS ${TACRYPTO_LIB_DIR}/tacrypto.lib)

ELSE()

	IF(CMAKE_TOOLCHAIN_FILE)
		IF (CMAKE_SYSTEM_NAME STREQUAL Android)

			IF (ANDROID_ABI STREQUAL armeabi-v7a)
				SET(TACRYPTO_DIR ${THIRD_PARTY}/android/tacrypto/armeabi-v7a)
			ELSEIF (ANDROID_ABI STREQUAL arm64-v8a)
				SET(TACRYPTO_DIR ${THIRD_PARTY}/android/tacrypto/arm64-v8a)
			ENDIF()

			SET(TACRYPTO_INCLUDE_DIR ${TACRYPTO_DIR}/include)
			SET(TACRYPTO_LIB_DIR ${TACRYPTO_DIR}/lib)
		ELSEIF (CMAKE_C_COMPILER MATCHES "hisiv300")
			SET(TACRYPTO_DIR ${THIRD_PARTY}/hisiv300/tacrypto)
			SET(TACRYPTO_INCLUDE_DIR ${TACRYPTO_DIR}/include)
			SET(TACRYPTO_LIB_DIR ${TACRYPTO_DIR}/lib)
		ELSEIF (CMAKE_C_COMPILER MATCHES "hisiv400")
			SET(TACRYPTO_DIR ${THIRD_PARTY}/hisiv400/tacrypto)
			SET(TACRYPTO_INCLUDE_DIR ${TACRYPTO_DIR}/include)
			SET(TACRYPTO_LIB_DIR ${TACRYPTO_DIR}/lib)
		ELSEIF (CMAKE_C_COMPILER MATCHES "hisiv500")
			SET(TACRYPTO_DIR ${THIRD_PARTY}/hisiv500/tacrypto)
			SET(TACRYPTO_INCLUDE_DIR ${TACRYPTO_DIR}/include)
			SET(TACRYPTO_LIB_DIR ${TACRYPTO_DIR}/lib)
		ELSEIF (CMAKE_C_COMPILER MATCHES "hisiv600")
			SET(TACRYPTO_DIR ${THIRD_PARTY}/hisiv600/tacrypto)
			SET(TACRYPTO_INCLUDE_DIR ${TACRYPTO_DIR}/include)
			SET(TACRYPTO_LIB_DIR ${TACRYPTO_DIR}/lib)
		ELSEIF (CMAKE_C_COMPILER MATCHES "himix100")
			SET(TACRYPTO_DIR ${THIRD_PARTY}/himix100/tacrypto)
			SET(TACRYPTO_INCLUDE_DIR ${TACRYPTO_DIR}/include)
			SET(TACRYPTO_LIB_DIR ${TACRYPTO_DIR}/lib)
		ELSEIF (CMAKE_C_COMPILER MATCHES "himix200")
			SET(TACRYPTO_DIR ${THIRD_PARTY}/himix200/tacrypto)
			SET(TACRYPTO_INCLUDE_DIR ${TACRYPTO_DIR}/include)
			SET(TACRYPTO_LIB_DIR ${TACRYPTO_DIR}/lib)
		ENDIF()
	ELSE()
		FIND_PATH(TACRYPTO_INCLUDE_DIR NAMES sm4.h PATHS ${THIRD_PARTY}/gcc/tacrypto/include)
		FIND_PATH(TACRYPTO_LIB_DIR NAMES libtacrypto.a PATHS ${THIRD_PARTY}/gcc/tacrypto/lib)
	ENDIF()	

	SET(TACRYPTO_LIBS ${TACRYPTO_LIB_DIR}/libtacrypto.a)

	#IF (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "aarch64")
	#SET(TACRYPTO_LIBRARY_DIR ${THIRD_PARTY}/tacrypto/arm ${TACRYPTO_DIR}/lib ${TACRYPTO_DIR}/bin)
	#ENDIF()
	#SET(TACRYPTO_LIBRARIES ssl crypto)
ENDIF()
